﻿using FastSocket.Server.Protocol;
using FastSocket.SocketBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SocketTool.Com.TCP.Server
{
    public class TCPServerProtocol : IProtocol<TCPServerMessage>
    {
        public CustomerProtocol Protocols { get; set; }

        public TCPServerMessage Parse(IConnection connection, ArraySegment<byte> buffer, int maxMessageSize, out int readlength)
        {
            var result = this.Protocols.Parse(buffer, out readlength);
            return new TCPServerMessage(result);
        }
    }
}
